From 2d4978ead4b98452bc45ebe47952e524b12e2b41 Mon Sep 17 00:00:00 2001 From: Jan Beulich Date: Fri, 3 Sep 2021 15:10:43 +0200 Subject: [PATCH] tests/xenstore: link in librt if necessary Old enough glibc has clock_gettime() in librt.so, hence the library needs to be specified to the linker. Newer glibc has the symbol available in both libraries, so make sure that libc.so is preferred (to avoid an unnecessary dependency on librt.so). Fixes: 93c9edbef51b ("tests/xenstore: Rework Makefile") Signed-off-by: Jan Beulich Reviewed-by: Juergen Gross Acked-by: Ian Jackson --- tools/tests/xenstore/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/tests/xenstore/Makefile b/tools/tests/xenstore/Makefile index b9969dd090..239e1dce47 100644 --- a/tools/tests/xenstore/Makefile +++ b/tools/tests/xenstore/Makefile @@ -33,6 +33,9 @@ CFLAGS += $(APPEND_CFLAGS) LDFLAGS += $(LDLIBS_libxenstore) LDFLAGS += $(APPEND_LDFLAGS) +ifeq ($(CONFIG_Linux),y) +LDFLAGS += -Wl,--as-needed -lc -lrt +endif %.o: Makefile -- 2.30.2